package cn.afterturn.svn.analysis.controller.repositoryinfo;

import org.apache.commons.lang3.StringUtils;
import org.nutz.dao.QueryResult;
import org.nutz.dao.pager.Pager;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.slf4j.Logger;
import cn.afterturn.svn.analysis.entity.repositoryinfo.RepositoryInfoEntity;
import cn.afterturn.svn.analysis.service.repositoryinfo.RepositoryInfoService;

/**
 * ���ñ� ����
 * @author JueYue
 * @date 2015-07-29 15:41
 * @version V1.0  
 */
@At("/repositoryinfo")
public class RepositoryInfoController {

    private static final Log LOGGER = Logs.get();

    @Inject
    private RepositoryInfoService repositoryInfoService;

    @At
    @Ok("jsp:repositoryinfo/repositoryInfoList")
    public void home(RepositoryInfoEntity entity) {
    }

    @At("repositoryinfo_list")
    @Ok("json")
    public QueryResult RepositoryInfoList(RepositoryInfoEntity entity, Pager pager) {
        QueryResult list = null;
        try {
            list = repositoryInfoService.getRepositoryInfoPage(entity, pager);
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return list;
    }
}
